package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.List;

public class MenuOptions {
    private static List<Option> menuOptions = new ArrayList<Option>();

    public MenuOptions() {
        init();
    }

    public void showMenu() {
        String separator = System.getProperty("line.separator");
        String menu = "We provide these service:" + separator;
        for (int i = 1; i <= menuOptions.size(); i++) {
            menu = menu + i + ". " + menuOptions.get(i - 1).getServiceDescription() + separator;
        }
        menu = menu + "Please input a number to select the service.";
        System.out.println(menu);
    }

    private void init() {
        this.menuOptions.add(new BooksViewController());
        this.menuOptions.add(new BooksReserveController());
        this.menuOptions.add(new MembershipController());
        this.menuOptions.add(new MoviesViewContriller());
    }

    public static List<Option> getMenuOptions() {
        return menuOptions;
    }
}
